package com.rkhd.account;

import com.rkhd.utils.HttpClientUtil;
import net.sf.json.JSONObject;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
import org.testng.annotations.Test;

import java.util.HashMap;
import java.util.Map;

/*
    获取 客户 相关的数据;
 */
public class CRM_Account {
    private static Logger logger = LoggerFactory.getLogger(CRM_Account.class);

    // 固定 account 客户实体对象的 ObjectId

    private final static String Account_accountobjectId = "1";
    /*
        组装需要客户传递 的 objectId参数
     */
    private static Map objectIdMap = new HashMap<String, Object>();
    private String id = "";


    @Test
    public  void test1(){
        System.out.println(222);
    }
    @Test
    public void test2(){
        System.out.println(111);
    }

    public CRM_Account() {

        this.id = Account_accountobjectId;
        objectIdMap.put("objectId", this.id);
    }

    /**
     *
     * @param url 需要请求的url地址
     * @return  : 获取保存客户后响应的 jsonObject
     */
    public static JSONObject getApplicationAccount_EntityType(String url) {
        String accountEntityTypestr = HttpClientUtil.doPost(url, objectIdMap);
        JSONObject accountEntityTypeJson = JSONObject.fromObject(accountEntityTypestr);
        return accountEntityTypeJson;

    }

    /**
     *
     * @param url 需要请求的url地址
     * @return  : 从响应结果中获取需要的 客户默认业务类型id数据
     */

    public static String getAccount_EntityType(String url) {
        JSONObject accountEntityTypeJson = getApplicationAccount_EntityType(url);
//        logger.info( "accountEntityTypeJson : "+accountEntityTypeJson);
        return null;
    }
}
